package com.diorsunion.hedge.io;

import java.io.Serializable;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Function;

/**
 * Created by dingshan.yyj on 2016/6/3.
 */
public interface MessageHandler  {
    Set<Class> handlerClasses();

    Map<String,Function<Serializable,Message>> getFunctionMap();
    default Function<Serializable,Message> getFunction(String functionName){
        Map<String,Function<Serializable,Message>> map = getFunctionMap();
        if(map!=null){
            return map.get(functionName);
        }
        return null;
    }
}
